<%--
  Created by IntelliJ IDEA.
  User: 10171225
  Date: 2016/4/7
  Time: 17:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>"/>
    <title>忘记密码</title>
    <script type="text/javascript">
        $(document).ready(function(){
            $("#sendVerifyCode").click(function(){
                $.ajax({
                    type : 'get',
                    contentType:"application/json;charset=utf-8",
                    url : 'user/sendVerifyCode',
                    dataType : 'json',
                    cache: false,
                    timeout: 5000,
                    async: false,
                    data: {
                        "userName" : $("#userName").val(),
                        "email": $("#email").val()
                    },
                    success: function(result){
                        alert(result);
                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                        alert("ajax异常，请联系管理员！");
                    }
                });
                $(this).innerWidth($(this).innerWidth());
                $(this).text("请查收邮箱");
                $(this).attr('disabled',"true");
                return false;
            });
        });
    </script>
</head>
<body>
    <div>
        <form method="post" action="user/forgetPasswordAction">
            <table>
                <tr>
                    <th>用户名：</th>
                    <td><input type="text" name="userName" id="userName"/></td>
                    <td></td>
                </tr>
                <tr>
                    <th>邮箱:</th>
                    <td><input type="text" name="email" id="email"/></td>
                    <td>&nbsp;<button id="sendVerifyCode">发送邮箱验证码</button></td>
                </tr>
                <tr>
                    <th>邮箱验证码：</th>
                    <td><input type="text" name="verifyCode" /></td>
                    <td></td>
                </tr>
                <tr>
                    <th></th>
                    <td><button name="submit" type="submit">下一步</button></td>
                    <td></td>
                </tr>
            </table>

        </form>
    </div>

</body>
</html>
